
    ##############################################################################################
    ### Figure 5  R code

    T1 <- 92
    T2 <- 114
    T <- length(T1:T2)  # number of congresses
    year.odd <- seq(from=1971, to=2015, by=2)
     
    Data <- read.csv("Figure5_data.csv", header=T)
    attach(Data)
    
    aa <- 0.05
    postscript("Figure5.eps", height=15, width=8, horizontal=F)
    par(mfrow=c(3, 1))
    plot(1:T, Senate_N_Dem_mean, type='n', col='blue', ylim=c(-3,3), xaxt="n", xlab="", ylab="")
    points(1:T, Senate_N_Dem_mean,  type='o', pch=21, lty=1, col='blue', cex=.8)
    segments(1:T, Senate_N_Dem_CI1, 1:T, Senate_N_Dem_CI2, col='blue')
    points(1:T+aa, Senate_S_Dem_mean,  type='o', pch=21, lty=3, col='purple', cex=.8)
    segments(1:T+aa, Senate_S_Dem_CI1, 1:T+aa, Senate_S_Dem_CI2, col='purple')
    points(1:T, Senate_N_Rep_mean,  type='o', pch=24, lty=1, col='red', cex=.8)
    segments(1:T, Senate_N_Rep_CI1, 1:T, Senate_N_Rep_CI2, col='red')
    points(1:T+aa, Senate_S_Rep_mean,  type='o', pch=24, lty=3, col='brown', cex=.8)
    segments(1:T+aa, Senate_S_Rep_CI1, 1:T+aa, Senate_S_Rep_CI2, col='brown')
    axis(side=1, las=3, at=1:T, labels=year.odd, cex.axis=.8)
    legend('bottomleft', legend=c("Non-Southern Democrats", "Southern Democrats", "Non-Southern Republicans", "Southern Republicans"), lty=c(1, 3, 1, 3), pch=c(21,21,24,24), col=c('blue','purple', 'red', 'brown'),cex=.8)
    title(main="Senate",  font.main=1)

    plot(1:T, House_N_Dem_mean, type='n', col='blue', ylim=c(-3,3), xaxt="n", xlab="", ylab="")
    points(1:T, House_N_Dem_mean,  type='o', pch=21, lty=1, col='blue', cex=.8)
    segments(1:T, House_N_Dem_CI1, 1:T, House_N_Dem_CI2, col='blue')
    points(1:T+aa, House_S_Dem_mean,  type='o', pch=21, lty=3, col='purple', cex=.8)
    segments(1:T+aa, House_S_Dem_CI1, 1:T+aa, House_S_Dem_CI2, col='purple')
    points(1:T, House_N_Rep_mean,  type='o', pch=24, lty=1, col='red', cex=.8)
    segments(1:T, House_N_Rep_CI1, 1:T, House_N_Rep_CI2, col='red')
    points(1:T+aa, House_S_Rep_mean,  type='o', pch=24, lty=3, col='brown', cex=.8)
    segments(1:T+aa, House_S_Rep_CI1, 1:T+aa, House_S_Rep_CI2, col='brown')
    axis(side=1, las=3, at=1:T, labels=year.odd, cex.axis=.8)
    legend('bottomleft', legend=c("Non-Southern Democrats", "Southern Democrats", "Non-Southern Republicans", "Southern Republicans"), lty=c(1, 3, 1, 3), pch=c(21,21,24,24), col=c('blue','purple', 'red', 'brown'),cex=.8)
    title(main="House",  font.main=1)

    plot(1:T, S.Dem.Senate.Share, type='o', pch=21, col='blue', ylim=c(0, 50), xaxt="n", xlab="",ylab="")
    points(1:T, S.Dem.House.Share,  type='o', pch=21, lty=2, col='blue')
    points(1:T, S.Rep.Senate.Share,  type='o', pch=24, lty=1, col='red')
    points(1:T, S.Rep.House.Share,  type='o', pch=24, lty=2, col='red')
    axis(side=1, las=3, at=1:T, labels=year.odd, cex.axis=.8)
    title(main="Southern members (% of each caucus)",  font.main=1)
    legend('bottomleft', legend=c("Southern Democrats (Senate)", "Southern Democrats (House)", "Southern Republicans (Senate)", "Southern Republicans (House)"), lty=c(1, 2, 1, 2), pch=c(21,21,24,24), col=c('blue', 'blue', 'red', 'red'), cex=.8)
 
    dev.off()

